//
//  MCViewController.m
//  MapleCell
//
//  Created by itzhaolei on 08/01/2019.
//  Copyright (c) 2019 itzhaolei. All rights reserved.
//

#import "MCViewController.h"
#import "MapleCellHeader.h"

@interface MCViewController ()<UITableViewDataSource,UITableViewDelegate>

@end

@implementation MCViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:(UITableViewStylePlain)];
    tableView.backgroundColor = [UIColor colorWithWhite:240 / 255.0 alpha:1.0];
    tableView.dataSource = self;
    tableView.delegate = self;
    tableView.separatorStyle = NO;
    [self.view addSubview:tableView];
}

#pragma mark - UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 2;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    MCBaseCell *cell = [MCBaseCell reuseCell:tableView IndexPath:indexPath];
    //整理控件
    cell.iconButton.frame = CGRectMake(10, 0, 60.0, 60.0);
    cell.titleLabel.frame = CGRectMake(70.0, 10.0, UIScreen.mainScreen.bounds.size.width - 70.0 - 40.0, 20.0);
    cell.subTitleLabel.frame = CGRectMake(70.0, 35.0, UIScreen.mainScreen.bounds.size.width - 70.0 - 40.0, 15.0);
    cell.arrowButton.hidden = NO;
    cell.bottomLine.hidden = !indexPath.row ? YES : NO;
    //进行赋值
    [cell.iconButton setImage:[UIImage imageNamed:@"微信登录"] forState:UIControlStateNormal];
    cell.titleLabel.text = @"这是个标题";
    cell.subTitleLabel.text = @"这里是一些描述字符串";
    return cell;
}

#pragma mark - UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return [MCBaseCell baseHeight];
}

@end
